/**
 *  项目详情窗口，可以更改
 */
Ext.ns('Ext.projectinfo');

Ext.projectinfo.Window = Ext.extend(Ext.Window,{
	maximizable:true,
	modal:true,
	cloasable : true,
	autoScroll: true,
	height: 600,
	width: 540,
	buttonAlign: 'center',
	layout : 'fit',
	initComponent : function(){
		this.updatePanel = new Ext.form.FormPanel({
			layout:'form',
			width : 500,
			autoHeight: true,
			items:[{
				xtype : 'hidden',
				id : this.id+'projectId',
				name : 'projectInfo.projectId'
			},{
				xtype:'textfield',
				fieldLabel : '项目编号',
				id : this.id+'projectNumber',
				name : 'projectInfo.projectNumber',
				readOnly: true
			},{
				xtype:'textfield',
				fieldLabel : '项目名称',
				id:this.id+'projectName',
				name : 'projectInfo.projectName',
				readOnly: true
			},{
				xtype:'textfield',
				fieldLabel : '所在地',
				id: this.id+'location',
				name : 'projectInfo.location'
			},{
				xtype : 'fieldset',
           	    fieldLabel : '主承办单位',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items: [{
           	    		   xtype :'hidden',
           	    		   id: this.id+'mainUndertakeUnitId',
	    				   name : 'projectInfo.mainUndertakeUnitId'
           	            },{
		           	    	xtype:'textfield',
		    				fieldLabel : '主承办单位',
		    				id: this.id+'mainUndertakeUnit',
		    				readOnly : true
           	            },{
	           	        	xtype:'button',
	           	        	id:'xbutton',
	           	        	text:'选择单位',
	           	        	width: 80,
	           	        	handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_selcetunit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_selectunit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = Ext.getCmp("dm_projectinfo_update");
		           	     		             p.updatePanel.findById(p.id+'mainUndertakeUnitId').setValue(record[0].get('unitid'));
		           	     		             p.findById(p.id+'mainUndertakeUnit').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
		           	        	 			
		           	        	 		});
		           	        	 	}
		           	        	 	n.findById('dm_unitgrid').store.load({
		           	        	 		params:{
		       	        	 			start:0,
		       	        	 			limit: 20
		           	        	 	}});
		           	        	 	n.show();
		           	         }
           	    }]
				
			},{
				xtype : 'fieldset',
           	    fieldLabel : '保证单位',
           	    layout : 'column',
           	    autoHeight: true,
           	    autoWidth: true,
           	    items: [{
           	    		   xtype :'hidden',
           	    		   id: this.id+'guaranteeUnitId',
	    				   name : 'projectInfo.guaranteeUnitId'
           	            },{
		           	    	xtype:'textfield',
		    				fieldLabel : '保证单位',
		    				id: this.id+'guaranteeUnit',
		    				readOnly : true
           	            },{
	           	        	xtype:'button',
	           	        	id:'xbutton',
	           	        	text:'选择单位',
	           	        	width: 80,
	           	        	handler : function(b,e){
	           	        	 	var n = Ext.getCmp('dm_selcetunit');
	           	        	 	if( n== null){
	           	        	 		n = new Ext.dm.ShowUnitWindow({
	           	        	 			id:'dm_selectunit',
	           	        	 			title:'选择单位',
	           	        	 			closable : true,
		           	        	 		buttons:[{
		           	     	            xtype:'button',
		           	     	            text : '确定',
		           	     	            handler : function(b,e){//把选择的值添加到单位输入框
		           	    					e.stopEvent();
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    					
		           	     	             var record = a.sm.getSelections();
		           	     	             
		           	     	             if(record != null && record[0] != null){
		           	     	            	 var p = Ext.getCmp("dm_projectinfo_update");
		           	     		             p.updatePanel.findById(p.id+'guaranteeUnitId').setValue(record[0].get('unitid'));
		           	     		             p.findById(p.id+'guaranteeUnit').setValue(record[0].get('unitname'));
		           	     		             a.close();
		           	     	             } else{
		           	     		             Ext.Msg.alert('请选择一项！');
		           	     	             }
		           	                  }
		           	    	          },{
		           	    	        	  xtype : 'button',
		           	    	        	  text : '取消',
		           	    	        	  handler : function(b, e){
		           	    					var a = b.findParentBy(function(ct, cmp) { 
		           	    						return (ct instanceof Ext.dm.ShowUnitWindow) ? true : false; 
		           	    					});
		           	    	        	  a.close();
		           	    	          }
		           	    	          }]
		           	        	 			
		           	        	 		});
		           	        	 	}
		           	        	 	n.findById('dm_unitgrid').store.load({
		           	        	 		params:{
		       	        	 			start:0,
		       	        	 			limit: 20
		           	        	 	}});
		           	        	 	n.show();
		           	         }
           	    }]
				
			},{
				xtype:'numberfield',
				fieldLabel : '立项年度',
				id: this.id+'establishProjectYear',
				name : 'projectInfo.establishProjectYear'
			},{
				xtype:'textfield',
				fieldLabel : '主管处室',
				id: this.id+'mainManagingDepartment',
				name : 'projectInfo.mainManagingDepartment'
			}, {
				xtype:'textfield',
				fieldLabel : '跟进人',
				id: this.id+'followUpPerson',
				readOnly:true
			}, {
				xtype:'textfield',
				fieldLabel : '项目类别',
				id: this.id+'projectPlanCatagory',
				name : 'projectInfo.projectPlanCatagory'
			}, {
				xtype:'textfield',
				fieldLabel : '领域',
				id: this.id+'field',
				name : 'projectInfo.field'
			}, {
				xtype:'textfield',
				fieldLabel : '子领域',
				id: this.id+'subfield',
				name : 'projectInfo.subfield'
			}, {
				xtype:'textfield',
				fieldLabel : '下达文件编号',
				id: this.id+'issueFileNumber',
				name : 'projectInfo.issueFileNumber'
			}, {
		    	xtype: 'datefield',
		    	fieldLabel: '合同开始日期',
		    	format : 'Y-m-d',
		    	id: this.id+'contractBegin',
				name : 'projectInfo.contractbegin'
		    }, {
		    	xtype: 'datefield',
		    	fieldLabel: '合同结束日期',
		    	format : 'Y-m-d',
		    	id: this.id+'contractEnd',
				name : 'projectInfo.contractend'
		    }, {
				xtype:'textfield',
				fieldLabel : '中标金额（万元）',
				id: this.id+'winBidMoney',
				name : 'projectInfo.winBidMoney'
			}, {
/*项目负责人信息   */		    	
		    	xtype : 'fieldset',
	          	fieldLabel : '项目负责人',
	          	layout : 'column',
	          	autoHeight: true,
	          	autoWidth: true,
	          	items : [{
	          	        	 xtype:'textfield',
	          	        	 fiedLabel:'项目负责人',
	          	        	 readOnly : true,
	          	        	 id:this.id+'projectDirector'
	          	         },{ //用于表单传递给后台但不用显示出来的控件
	          	        	 xtype : 'hidden',
	          	        	 fiedLabel:'id',
	          	        	 id:this.id+'projectDirectorId',
	          	        	 readOnly : true
						 },{
	          	        	 xtype:'button',
	          	        	 text:'选择项目负责人',
	          	        	 width: 80,
	          	        	 handler : function(b,e){
	
	          	        	 	var n = Ext.getCmp('dm_selectdirector');
	          	        	 	if( n== null){
	          	        	 		n = new Ext.dm.ShowDirectorWindow({
	          	        	 			id:'dm_selectdirector',
	          	        	 			title:'选择负责人',
	          	        	 			closable : true,
	          	        	 			buttons : [{
	          	       	        	    xtype:'button',
	          	       	        	    text : '确定',
	          	       	        	    handler : function(b,e){
	          	       		
	          	       					e.stopEvent();
	          	       						var a = b.findParentBy(function(ct, cmp) { 
	          	       								return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       						});
	          	       		

	          	       	        	   var record = a.sm.getSelections();
	          	       	        	   if(record != null && record[0] != null){
		           	     	               var p = Ext.getCmp("dm_projectinfo_update");
	          	       	        		   p.updatePanel.findById(p.id+'projectDirectorId').setValue(record[0].get('personid'));
	          	       	        		   p.findById(p.id+'projectDirector').setValue(record[0].get('name'));
	          	       	        		   a.close();
	          	       	        	   } else{
	          	       	        		   Ext.Msg.alert('请选择一项！');
	          	       	        	   }
	          	       	           }
	          	       	           },{
	          	       	        	   xtype : 'button',
	          	       	        	   text : '取消',
	          	       	        	   handler : function(b, e){
	          	       	        	   		var a = b.findParentBy(function(ct, cmp) { 
	          	       	        	   			return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       	        	   		});
	          	       	        	   		a.close();
	          	       	           }
	          	       	           }]
	          	        	 		});
	          	        	 	}
	          	        	 	n.grid.store.load({
	          	        	 		params:{
	          	        	 			start:0,
	          	        	 			limit: 20
	          	        	 	}
	          	        	 	});
	          	        	 	n.show();
	          	         
	          	         }
	          	         }]
		    }, {
/*项目联系人信息   */		    	
		    	xtype : 'fieldset',
	          	fieldLabel : '项目联系人',
	          	layout : 'column',
	          	border:false,
	          	autoHeight: true,
	          	autoWidth: true,
	          	items : [{
	          	        	 xtype:'textfield',
	          	        	 fiedLabel:'项目联系人',
	          	        	 readOnly : true,
	          	        	 id:this.id+'contactMan'
	          	         },{ //用于表单传递给后台但不用显示出来的控件
	          	        	 xtype : 'hidden',
	          	        	 fiedLabel:'id',
	          	        	 id:this.id+'contactManId',
	          	        	 readOnly : true
						 },{
	          	        	 xtype:'button',
	          	        	 text:'选择项目联系人',
	          	        	 width: 80,
	          	        	 handler : function(b,e){
	
	          	        	 	var n = Ext.getCmp('dm_selectdirector');
	          	        	 	if( n== null){
	          	        	 		n = new Ext.dm.ShowDirectorWindow({
	          	        	 			id:'dm_selectdirector',
	          	        	 			title:'选择联系人',
	          	        	 			closable : true,
	          	        	 			buttons : [{
	          	       	        	    xtype:'button',
	          	       	        	    text : '确定',
	          	       	        	    handler : function(b,e){
	          	       		
	          	       					e.stopEvent();
	          	       						var a = b.findParentBy(function(ct, cmp) { 
	          	       								return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       						});
	          	       		

	          	       	        	   var record = a.sm.getSelections();
	          	       	        	   if(record != null && record[0] != null){
		           	     	               var p = Ext.getCmp("dm_projectinfo_update");
	          	       	        		   p.updatePanel.findById(p.id+'contactManId').setValue(record[0].get('personid'));
	          	       	        		   p.findById(p.id+'contactMan').setValue(record[0].get('name'));
	          	       	        		   a.close();
	          	       	        	   } else{
	          	       	        		   Ext.Msg.alert('请选择一项！');
	          	       	        	   }
	          	       	           }
	          	       	           },{
	          	       	        	   xtype : 'button',
	          	       	        	   text : '取消',
	          	       	        	   handler : function(b, e){
	          	       	        	   		var a = b.findParentBy(function(ct, cmp) { 
	          	       	        	   			return (ct instanceof Ext.dm.ShowDirectorWindow) ? true : false; 
	          	       	        	   		});
	          	       	        	   		a.close();
	          	       	           }
	          	       	           }]
	          	        	 		});
	          	        	 	}
	          	        	 	n.grid.store.load({
	          	        	 		params:{
	          	        	 			start:0,
	          	        	 			limit: 20
	          	        	 	}
	          	        	 	});
	          	        	 	n.show();
	          	         
	          	         }
	          	         }]
		    }, {
			    xtype: 'datefield',
		    	fieldLabel: '验收时间',
		    	format : 'Y-m-d',
		    	id: this.id+'checkDate' 
			}, {
			    xtype: 'combo',
		    	fieldLabel: '项目进度',
		    	id: this.id+'projectSchedule',
		    	store: new Ext.data.SimpleStore({
		    		fields: ['value','text'],
		    		data: [
		    		       ['0','合同评审阶段'],
		    		       ['1','实施阶段'],
		    		       ['2','已到期未验收'],
		    		       ['3','已验收'],
		    		       ['4','延期'],
		    		       ['5','合同签订'],
		    		       ['6','项目实施'],
		    		       ['7','项目到期未验收'],
		    		       ['8','准备验收'],
		    		       ['9','结题']
		    		       ]
		    	}),
		    	displayField: 'text',
		    	valueField: 'value',
		    	triggerAction:  'all',
		    	mode: 'local',
		    	emptyText: '请选择' 
			}, {
			    xtype: 'combo',
		    	fieldLabel: '项目变更情况',
		    	id: this.id+'projectChange',
		    	store: new Ext.data.SimpleStore({
		    		fields: ['value','text'],
		    		data: [
		    		       ['1','已完成项目负责人变更'],
		    		       ['2','已提出延期申请变更']
		    		       ]
		    	}),
		    	displayField: 'text',
		    	valueField: 'value',
		    	triggerAction:  'all',
		    	mode: 'local',
		    	emptyText: '请选择'
			}, {
			    xtype : 'fieldset',
                title :'发明专利',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '发明专利',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: this.id+'inventPatentApplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: this.id+'inventPatentAuthorization'
                }]
			}, {
			    xtype : 'fieldset',
                title :'实用新型',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '实用新型',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: this.id+'useNewApplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: this.id+'useNewAuthorization'
                }]
			}, {
			    xtype : 'fieldset',
                title :'外观设计',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '外观设计',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '申请',
    		    	id: this.id+'appearanceDesignApplication'
    		    	
    	    	},{
    	    		xtype: 'numberfield',
    		    	fieldLabel: '授权',
    		    	id: this.id+'appearanceDesignAuthorization'
                }]
			}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '外国专利',
		    	id: this.id+'foreignPatent'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '新工艺',
		    	id: this.id+'newTechnology'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '新产品',
		    	id: this.id+'newProduct'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '新材料',
		    	id: this.id+'newMaterial'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '新设备',
		    	id: this.id+'newEquipment'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '计算机软件',
		    	id: this.id+'computerSoftware'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '论文论著',
		    	id: this.id+'paper'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '技术标准',
		    	id: this.id+'technologyStandard'
	    	}, {
	    		xtype : 'fieldset',
                title :'科技成果奖励',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '科技成果奖励',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
                	fieldLabel: '国家级',
//    		    	width: 50,
    		    	id: this.id+'nationalAward'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '省部级',
    		    	id: this.id+'provincialAward'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '市级',
    		    	id: this.id+'cityAward'
                }]
	    	}, {
	    		xtype : 'fieldset',
                title :'培养人才',
                collapsible : true, //可折叠
                collapseFirst : true,
                fieldLabel: '培养人才',
                autoHeight: true,
                layout: 'form',
                items: [{
                	xtype: 'numberfield',
    		    	fieldLabel: '博士',
    		    	id: this.id+'doctor'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '硕士',
    		    	id: this.id+'master'
                },{
                	xtype: 'numberfield',
    		    	fieldLabel: '本科',
    		    	id: this.id+'undergraduate'
                }]
	    	}, {

	    		xtype: 'numberfield',
		    	fieldLabel: '到位经费（万元）',
		    	id: this.id+'fundsAvailable'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '经费投入（万元）',
		    	id: this.id+'fundsInvestment'
	    	}, {
	    		xtype: 'numberfield',
		    	fieldLabel: '已获收益（万元）',
		    	id: this.id+'benefitAcquired'
	    	}, {
			    xtype: 'textarea',
	    		fieldLabel: '项目总结',
	    		id: this.id+'projectSummary',
	    		width: 500,
	    		grow: true,
	    		preventScrollbars: true,
	    		allowBlank: true
			}]
		});
		
		this.items = this.updatePanel;
		Ext.unit.Window.superclass.initComponent.call(this);
}
})


function project_operation(
    projectId,
	projectNumber,
	projectName,
	location,
	mainUndertakeUnitId,
	mainUndertakeUnit,
	guaranteeUnitId,
	guaranteeUnit,
	establishProjectYear,
	mainManagingDepartment,
	followUpPerson,
	projectPlanCatagory,
	field,
	subfield,
	issueFileNumber,
	contractBegin,
	contractEnd,
	winBidMoney,
	projectDirectorId,
	projectDirector,
	contactManId,
	contactMan,
	checkDate,
	projectSchedule,
	projectChange,
	inventPatentApplication,
	inventPatentAuthorization,
	useNewApplication,
	useNewAuthorization,
	appearanceDesignApplication,
	appearanceDesignAuthorization,
	foreignPatent,
	newTechnology,
	newProduct,
	newMaterial,
	newEquipment,
	computerSoftware,
	paper,
	technologyStandard,
	nationalAward,
	provincialAward,
	cityAward,
	doctor,
	master,
	undergraduate,
	fundsAvailable,
	fundsInvestment,
	benefitAcquired,
	projectSummary
	)
	{
	var a  = Ext.getCmp("dm_projectinfo_update");
	if(a == null ){
		a= new Ext.projectinfo.Window({
			autoScroll: true,
			id : "dm_projectinfo_update",
			closable : true,
			title : "修改项目信息",
			buttons : [{
				xtype:'button',
				text:'确定',
				handler : function(b,e){
					var a = b.findParentBy(function(ct, cmp) { 
						return (ct instanceof Ext.projectinfo.Window) ? true : false; 
					});
					var c = a.updatePanel;

					var b1,b2,b3,b4;
					b1= c.findById(a.id+'mainUndertakeUnitId').getValue();
					b2= c.findById(a.id+'guaranteeUnitId').getValue();
					b3= c.findById(a.id+'projectDirectorId').getValue();
					b4= c.findById(a.id+'contactManId').getValue();
					if(b1== -1)
						b1="";
					if(b2== -1)
						b2="";
					if(b3== -1)
						b3="";
					if(b4== -1)
						b4="";
						
					c.form.submit({
						url:'dataManage/dataManageAction!updateProject',
						method: 'post',
						success : function(form,action){
							Ext.Msg.alert('提示','更新项目信息成功！');
							Ext.getCmp('manage').getStore().reload();
							//更新成功之后刷新store
							var n = Ext.getCmp('dm_selcetproject');
							if(n != null)
								n.grid.store.load({
									params:{
          	        	 				start:0,
          	        	 				limit: 30
								}
								});
					},
						failure : function(form,action){
							Ext.Msg.alert('提示','更新项目信息失败！');
					},
						params : {
							projectid: c.findById(a.id+'projectId').getValue(),
							projectnumber: c.findById(a.id+'projectNumber').getValue(),
							projectname: c.findById(a.id+'projectName').getValue(),
							location: c.findById(a.id+'location').getValue(),
							mainundertakeunit: b1,
							guaranteeunit: b2,
							establishprojectyear: c.findById(a.id+'establishProjectYear').getValue(),
							mainmanagingdepartment: c.findById(a.id+'mainManagingDepartment').getValue(),
							projectplancatagory: c.findById(a.id+'projectPlanCatagory').getValue(),
							field: c.findById(a.id+'field').getValue(),
							subfield: c.findById(a.id+'subfield').getValue(),
							issuefilenumber: c.findById(a.id+'issueFileNumber').getValue(),
							contractbegin: c.findById(a.id+'contractBegin').getRawValue(),
							contractend: c.findById(a.id+'contractEnd').getRawValue(),
							winbidmoney: c.findById(a.id+'winBidMoney').getValue(),
							projectdirector: b3,
							contactman: b4,
							checkdate: c.findById(a.id+'checkDate').getRawValue(),
							projectschedule: c.findById(a.id+'projectSchedule').getValue(),
							projectchange: c.findById(a.id+'projectChange').getValue(),
							inventpatentapplication: c.findById(a.id+'inventPatentApplication').getValue(),
							inventpatentauthorization: c.findById(a.id+'inventPatentAuthorization').getValue(),
							usenewapplication: c.findById(a.id+'useNewApplication').getValue(),
							usenewauthorization: c.findById(a.id+'useNewAuthorization').getValue(),
							appearancedesignapplication: c.findById(a.id+'appearanceDesignApplication').getValue(),
							appearancedesignauthorization: c.findById(a.id+'appearanceDesignAuthorization').getValue(),
							foreignpatent: c.findById(a.id+'foreignPatent').getValue(),
							newtechnology: c.findById(a.id+'newTechnology').getValue(),
							newproduct: c.findById(a.id+'newProduct').getValue(),
							newmaterial: c.findById(a.id+'newMaterial').getValue(),
							newequipment: c.findById(a.id+'newEquipment').getValue(),
							computersoftware: c.findById(a.id+'computerSoftware').getValue(),
							paper: c.findById(a.id+'paper').getValue(),
							technologystandard: c.findById(a.id+'technologyStandard').getValue(),
							nationalaward: c.findById(a.id+'nationalAward').getValue(),
							provincialaward: c.findById(a.id+'provincialAward').getValue(),
							cityaward: c.findById(a.id+'cityAward').getValue(),
							doctor: c.findById(a.id+'doctor').getValue(),
							master: c.findById(a.id+'master').getValue(),
							undergraduate: c.findById(a.id+'undergraduate').getValue(),
							fundsavailable: c.findById(a.id+'fundsAvailable').getValue(),
							fundsinvestment: c.findById(a.id+'fundsInvestment').getValue(),
							benefitacquired: c.findById(a.id+'benefitAcquired').getValue(),
							projectsummary: c.findById(a.id+'projectSummary').getValue()
						}
					});
					a.close();
			}
			},'-',{
				xtype:'button',
				text:'取消',
				handler : function(b,e){
					var a = b.findParentBy(function(ct, cmp) { 
						return (ct instanceof Ext.projectinfo.Window) ? true : false; 
					});
					a.close();
			}
			}]
		});
	}
	
	a.updatePanel.findById(a.id+'projectId').setValue(projectId);
	a.updatePanel.findById(a.id+'projectNumber').setValue(projectNumber);
	a.updatePanel.findById(a.id+'projectName').setValue(projectName);
	a.updatePanel.findById(a.id+'location').setValue(location);
	a.updatePanel.findById(a.id+'mainUndertakeUnitId').setValue(mainUndertakeUnitId);
	a.updatePanel.findById(a.id+'mainUndertakeUnit').setValue(mainUndertakeUnit);
	a.updatePanel.findById(a.id+'guaranteeUnitId').setValue(guaranteeUnitId);
	a.updatePanel.findById(a.id+'guaranteeUnit').setValue(guaranteeUnit);
	a.updatePanel.findById(a.id+'establishProjectYear').setValue(establishProjectYear);
	a.updatePanel.findById(a.id+'mainManagingDepartment').setValue(mainManagingDepartment);
	a.updatePanel.findById(a.id+'followUpPerson').setValue(followUpPerson);
	a.updatePanel.findById(a.id+'projectPlanCatagory').setValue(projectPlanCatagory);
	a.updatePanel.findById(a.id+'field').setValue(field);
	a.updatePanel.findById(a.id+'subfield').setValue(subfield);
	a.updatePanel.findById(a.id+'issueFileNumber').setValue(issueFileNumber);
	a.updatePanel.findById(a.id+'contractBegin').setValue(contractBegin);
	a.updatePanel.findById(a.id+'contractEnd').setValue(contractEnd);
	a.updatePanel.findById(a.id+'winBidMoney').setValue(winBidMoney);
	a.updatePanel.findById(a.id+'projectDirectorId').setValue(projectDirectorId);
	a.updatePanel.findById(a.id+'projectDirector').setValue(projectDirector);
	a.updatePanel.findById(a.id+'contactManId').setValue(contactManId);
	a.updatePanel.findById(a.id+'contactMan').setValue(contactMan);
	a.updatePanel.findById(a.id+'checkDate').setValue(checkDate);
	a.updatePanel.findById(a.id+'projectSchedule').setValue(projectSchedule);
	a.updatePanel.findById(a.id+'projectChange').setValue(projectChange);
	a.updatePanel.findById(a.id+'inventPatentApplication').setValue(inventPatentApplication);
	a.updatePanel.findById(a.id+'inventPatentAuthorization').setValue(inventPatentAuthorization);
	a.updatePanel.findById(a.id+'useNewApplication').setValue(useNewApplication);
	a.updatePanel.findById(a.id+'useNewAuthorization').setValue(useNewAuthorization);
	a.updatePanel.findById(a.id+'appearanceDesignApplication').setValue(appearanceDesignApplication);
	a.updatePanel.findById(a.id+'appearanceDesignAuthorization').setValue(appearanceDesignAuthorization);
	a.updatePanel.findById(a.id+'foreignPatent').setValue(foreignPatent);
	a.updatePanel.findById(a.id+'newTechnology').setValue(newTechnology);
	a.updatePanel.findById(a.id+'newProduct').setValue(newProduct);
	a.updatePanel.findById(a.id+'newMaterial').setValue(newMaterial);
	a.updatePanel.findById(a.id+'newEquipment').setValue(newEquipment);
	a.updatePanel.findById(a.id+'computerSoftware').setValue(computerSoftware);
	a.updatePanel.findById(a.id+'paper').setValue(paper);
	a.updatePanel.findById(a.id+'technologyStandard').setValue(technologyStandard);
	a.updatePanel.findById(a.id+'nationalAward').setValue(nationalAward);
	a.updatePanel.findById(a.id+'provincialAward').setValue(provincialAward);
	a.updatePanel.findById(a.id+'cityAward').setValue(cityAward);
	a.updatePanel.findById(a.id+'doctor').setValue(doctor);
	a.updatePanel.findById(a.id+'master').setValue(master);
	a.updatePanel.findById(a.id+'undergraduate').setValue(undergraduate);
	a.updatePanel.findById(a.id+'fundsAvailable').setValue(fundsAvailable);
	a.updatePanel.findById(a.id+'fundsInvestment').setValue(fundsInvestment);
	a.updatePanel.findById(a.id+'benefitAcquired').setValue(benefitAcquired);
	a.updatePanel.findById(a.id+'projectSummary').setValue(projectSummary);

	//打开窗口
	a.show();
}